import java.util.Scanner;

public class T2 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int sum=0;
        if(n<10){
            for (int i = 1; i <= n; i++) {
                if(i==10){

                }
                 sum+=i;
            }
            System.out.println(sum);
        }

         else {
            int t=n/10;
            sum+=45*(t);
            int a=n-10*t;
            for (int j = 1; j <= a; j++) {
                sum+=j;
            }
            System.out.println(sum);
        }
    }
}
